xc: deal with xen/evtchn and xen/gntdev device names
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 1 Jun 2010 06:04:35 +0000 (07:04 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 1 Jun 2010 06:04:35 +0000 (07:04 +0100)
commitf6a50a21e5b9819494fa24f9778bb422e27b3e69
treecdcb8559f90456cc0421acd413d98a3a7c7f22ed
parent0b086b2583584fe0f8313250bc436164f937fd35
xc: deal with xen/evtchn and xen/gntdev device names

This patch makes xc_linux properly deal with:
 1. discovering and creating device nodes if necessary
 2. the new form of xen/<dev> device names soon to be used by the
 kernel

This changes the logic slightly:
 - If a device node already exists with the proper name, then it uses
 it as-is, assuming it has already been correctly created.
 - If the path doesn't exist, or it exists but isn't a device node,
 and
   it has successfully found the major/minor for the device, then
   (re)create the device node.

Since this logic is identical for gntdev and evtchn, make a common
function to handle both.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
tools/libxc/xc_linux.c